<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>订单签收</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="viewport" content="width=320.1, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <%@ include file="/WEB-INF/views/common/resource.jsp" %>
    <%@ include file="/WEB-INF/views/common/wx_tool.jsp" %>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
</head>
<body>
<div class="pop_bg"></div>
<div class="pop_box np" id="qrsh_box">
    <img src="${itx}/images/pop_box_bg.png" width="100%" />
    <div class="qr_box">
        <p>订单号1234567895555555</p>
        <span>待收货</span><br>
        <div class="qr_img_box"><img src="${itx}/images/demo/demo.jpg" width="100%" /></div>
    </div>
    <p style="margin: 10% 0;">配送员扫描二维码成功<br/>则表明这单交易完成</p>
    <em class="close_pop"><img src="${itx}/images/close_icon.png" width="35" /></em>
</div>
<div class="pop_box np" id="qrsh_complete_box">
    <img src="${itx}/images/pop_box_bg1.png" width="100%" />
    <em class="close_pop"><img src="${itx}/images/close_icon.png" width="35" /></em>
</div>
<script>
    var goods_no_array = new Array();
</script>

<input type="hidden" id="order_no" value="${order.order_no}">
<input type="hidden" id="order_check_code" value="${order.check_code}">
<div class="page order pt0">
    <div class="order_detil_head">
        <h1>订单号1234567895555555</h1>
        <span class="complete">待送达</span>
    </div>
    <input type="hidden" id="order_price" value="${order.order_price}">
    <div class="order_detil_content">
        <div class="order_detil_infobox">
            <h1>商品清单</h1>
            <ul class="order_detil_prolist">
                <c:forEach var="detail" items="${order.order_details}">
                    <c:if test="${detail.type eq 'MAIN'}">
                        <script>
                            goods_no_array.push('${detail.goods_no}');
                        </script>

                        <input type="hidden" id="price_${detail.goods_no}" value="${detail.goods_price}">

                        <input type="hidden" id="unit_price_${detail.goods_no}" value="${detail.goods_unit_price}">

                        <input type="hidden" id="num_${detail.goods_no}" value="${detail.goods_num}">

                        <input type="hidden" id="final_num_${detail.goods_no}" value="${detail.goods_num}">
                        <li>
                            <div class="pro_img_box"><img src="${detail.goods_img}" width="70" height="70" /></div>
                            <div class="pro_info_box">
                                <strong>${detail.goods_name}</strong>
                                <span>¥${detail.goods_price}</span>
                            </div>
                            <div class="pro_info_box bottom">
                                <em>规格：${detail.goods_specifications}</em>
                                <span>X${detail.goods_num}</span>
                            </div>
                        </li>
                        <div class="pro_total_box">
                            <span>签收数量：</span>
                            <div class="increase_box shopper">
                                <i class="iconfont icon-jian jian" goods_no="${detail.goods_no}" onclick="subNum(this)"></i>
                                <span class="num" id="show_num_${detail.goods_no}">${detail.goods_num}</span>
                                <i class="iconfont icon-jia plus" goods_no="${detail.goods_no}" onclick="plusNum(this)"></i>
                            </div>
                            <p>销售金额：<span>¥<font id="show_price_${detail.goods_no}">${detail.goods_price}</font></span></p>
                        </div>
                    </c:if>
                </c:forEach>
            </ul>
        </div>
        <c:forEach var="detail" items="${order.order_details}">
            <c:if test="${detail.type eq 'GIVEAWAY'}">
                <div class="order_detil_infobox">
                    <ul class="order_detil_prolist">
                        <li style="padding: 0; border-bottom: none;">
                            <div class="free_info_box">
                                <em>赠</em>
                                <span>${detail.goods_name}</span>
                            </div>
                            <div class="pro_img_box"><img src="${detail.goods_img}" width="70" height="70" /></div>
                            <div class="pro_info_box">
                                <strong>${detail.goods_name}</strong>
                                <span>¥0</span>
                            </div>
                            <div class="pro_info_box bottom">
                                <em>规格：${detail.goods_specifications}</em>
                                <span>X1</span>
                            </div>
                        </li>
                    </ul>
                </div>
            </c:if>
        </c:forEach>

        <c:if test="${order.is_price_off eq 1}">
        <div class="order_detil_infobox">
            <ul class="order_detil_prolist">
                <li style="padding: 0; border-bottom: none;">
                    <div class="free_info_box">
                        <em>减</em>
                        <span>已减${order.off_price}元</span>
                    </div>
                </li>
            </ul>
        </div>
        </c:if>

        <div class="clear"></div>
    </div>
    <div class="bottom_btns">
        <ul>
            <li style="background: #DCDCDC; color: #1E1E1E; text-align: left; padding-left: 7px;">
                <span style="margin-right: 15px;">共${fn:length(order.order_details)}件</span>
                应收货款：¥<font id="show_order_price">${order.order_price}</font>
            </li>
            <li onclick="doSign()">确认签收</li>
        </ul>
    </div>
</div>
<script type="text/javascript">
//    $('.plus').click(function(e){
//        var this_num = parseInt($(this).prev('span').html());
//        this_num ++;
//        $(this).prev('span').html(this_num);
//    })
//
//    $('.jian').click(function(e){
//        var this_num = parseInt($(this).next().html());
//        if(this_num <= 1){
//            return;
//        }
//        this_num --;
//        $(this).next().html(this_num);
//    })
</script>

<script src="${rtx}/js/signOrder.js"></script>
</body>
</html>
